﻿namespace calss_6_elseif_switch练习
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //实现简单计算器
            Console.WriteLine("计算器使用规则：输入数字和运算符号后需要按下回车键");
            string fin;
            
                float num1;
                float num2;
                string op;
                float num3;

                Console.WriteLine("请输入第一个数：");
                num1 = Convert.ToSingle(Console.ReadLine());

                Console.WriteLine("请输入运算符（+，-，*，/）");
                op = Console.ReadLine();

                Console.WriteLine("请输入第二个数");
                num2=Convert.ToSingle(Console.ReadLine());

                switch(op)
                {
                    case "+":Console.WriteLine("结果为" + (num1 + num2));break;

                        case "-":Console.WriteLine("结果为"+(num1 - num2));break;
                        case "*":Console.WriteLine("结果为" + (num1 * num2)); break;
                    case "/":Console.WriteLine("结果为" + (num1 / num2));break;
                }


            
            












        }
    }
}
